12 REM [][][][][][][][][][][][][] EVEN.WINS [][] REVISED FOR APPLE ][ + [][] BY GENE WEBER [][] DECEMBER 19, 1981 [][] FINAL VERSION DONE [][] FEBRUARY 6, 1983 [][][][][][][][][][][][][][][]
13 REM [][][][][][][][][][][][][] ORIGINAL PROGRAM BY [][] ERIC PETERS [][] [][] BASIC PLUS VERSION BY [][] DAVID AHL [][] [][][][][][][][][][][][][][][]
26 GOSUB 1700
30 ONERR GOTO 710
200 HOME : VTAB 10: HTAB 9: PRINT "THE GAME OF EVEN WINS": PRINT
210 HTAB 9: PRINT "INSTRUCTIONS (Y OR N)? ";: GET A$: PRINT : IF A$ < >"Y" THEN 230
225 GOSUB 730
230 DIM R(1,5)
250 LET L = 0:E = 0:G = 0:W = 0
260 FOR I = 0 TO 5:R(1,I) = 4:R(0,I) = 4: NEXT
270 LET A = 0: LET B = 0
280 DEF FN A(X) = INT(X +.5)
290 LET G = G +1
300 LET P = INT((13 * RND(1) +9)/2) *2 +1
310 IF P = 1 THEN 670
320 HOME : VTAB 10
325 PRINT "YOU HAVE ";A;" CHIPS.": PRINT
330 PRINT "THERE ARE "P" CHIPS ON THE BOARD."
340 LET E1 = E:L1 = L
350 LET E = (A/2 - INT(A/2)) *2
360 LET L = INT((P/6 - INT(P/6)) *6 +.5)
370 IF R(E,L) > = P THEN 500
380 LET M = R(E,L)
390 IF M < = 0 THEN 540
400 LET P = P -M
410 IF M = 1 THEN 660
420 PRINT "COMPUTER TAKES "M" CHIPS LEAVING "P
430 PRINT ". . . YOUR MOVE . . .";
440 LET B = B +M: GET M$:M = VAL(M$):M = INT(M): PRINT
450 REM
460 IF M <1 THEN 610
470 IF M >4 OR M >P THEN 620
480 IF M = P THEN 530
490 LET P = P -M: LET A = A +M: GOTO 310
500 IF P = 1 THEN 680
510 PRINT "COMPUTER TAKES "P" CHIPS"
520 LET R(F,L) = P: LET B = B +P
530 IF B/2 = INT(B/2) THEN 590
540 HOME : VTAB 12: HTAB 5: PRINT "THE GAME IS OVER . . . ";: INVERSE : PRINT " YOU WIN! ": NORMAL : GOSUB 9100: PRINT
550 LET W = W +1
560 IF R(E,L) = 1 THEN 630
570 LET R(E,L) = R(E,L) -1
580 GOTO 650
590 HOME : VTAB 12: HTAB 6: PRINT "THE GAME IS OVER . . ";: INVERSE : PRINT " I WIN!! ": NORMAL : PRINT "<CTRL-G><CTRL-G><CTRL-G>": GOTO 650
600 PRINT
610 IF M = 0 THEN 690
620 PRINT M" IS AN ILLEGAL MOVE . . YOUR MOVE ";: GOTO 440
630 IF R(E1,L1) = 1 THEN 650
640 LET R(E1,L1) = R(E1,L1) -1
650 HTAB 5: INVERSE : PRINT : HTAB 6: PRINT " YOU'VE WON "W" OUT OF "G" GAMES ": GOSUB 930: GOTO 270
660 PRINT "I TAKE 1 CHIP LEAVING "P" . . YOUR MOVE ";: GOTO 440
670 PRINT "THERE IS 1 CHIP ON THE BOARD ": GOTO 340
680 PRINT "I TAKE 1 CHIP . .": GOTO 520
690 IF G <2 THEN HOME : VTAB 12: HTAB 6: PRINT "SORRY YOU DIDN'T WANT TO PLAY ": VTAB 23: GOTO 720
695 HOME : VTAB 12: HTAB 6: PRINT "YOU PLAYED "G -1" GAMES AND WON "W
710 HTAB 5: PRINT "HOPE YOU HAD FUN . . . BYE, BYE ": VTAB 23
720 GOSUB 9000: END
730 HOME : VTAB 1
735 VTAB 2: HTAB 16: INVERSE : PRINT " EVEN ": NORMAL : VTAB 5
740 PRINT "HERE'S HOW THE GAME IS PLAYED: "
760 PRINT " AT THE BEGINNING OF A GAME, A RANDOM ": PRINT "NO. OF CHIPS IS PLACED ON THE BOARD. THE": PRINT "NUMBER OF CHIPS ALWAYS STARTS AS AN ODD ": PRINT "NUMBER. ON EACH TURN, A PLAYER MUST "
770 PRINT "TAKE ONE,TWO,THREE OR FOUR CHIPS. THE ": PRINT "WINNER IS THE PLAYER WHO FINSIHES WITH ": PRINT "A TOTAL NUMBER OF CHIPS THAT IS EVEN. ": PRINT "THE COMPUTER STARTS OUT KNOWING ONLY THE"
775 GOSUB 930: VTAB 8
780 PRINT "RULES OF THE GAME. IT GRADUALLY LEARNS ": PRINT "TO PLAY WELL. IT SHOULD BE DIFFICULT TO ": PRINT "BEAT THE COMPUTER 20 GAMES IN A ROW. "
790 PRINT "JUST TRY IT!!!!": PRINT : PRINT "TO QUIT TYPE '0' AS YOUR MOVE ": PRINT
900 GOSUB 930
920 RETURN
930 NORMAL : VTAB 23: HTAB 10: PRINT " < PRESS ANY KEY > ";: GET X$: PRINT : HOME : RETURN
1699 END
1700 HOME
1710 FOR I = 1 TO 39: PRINT "%";: NEXT I
1720 HTAB 0
1730 FOR I = 1 TO 22: HTAB 1: VTAB I: PRINT "%";: NEXT I
1740 FOR I = 1 TO 39: VTAB 22: HTAB I: PRINT "%";: NEXT I
1750 FOR I = 22 TO 1 STEP -1: HTAB 39: VTAB I: PRINT "%";: NEXT I
1755 FLASH
1770 VTAB 6: HTAB 15: PRINT " APPLE ][ "
1780 VTAB 10: HTAB 15
1790 PRINT " "
1800 HTAB 15
1810 PRINT " EVEN.WINS "
1820 HTAB 15
1830 PRINT " "
1840 IF X = 0 THEN GOSUB 9000
1850 NORMAL
1860 IF X = 1 THEN 1900
1870 LET X = 1
1880 NORMAL : GOTO 1770
1900 REM
1910 HTAB 16
1920 PRINT "GENE WEBER"
1930 PRINT
1940 HTAB 19
1950 PRINT "1983"
1960 VTAB 18: HTAB 11: PRINT "SOUND BY BEAGLE BROS"
1970 FOR I = 1 TO 3000: NEXT I
1980 RETURN
2000 VTAB 23: HTAB 10: PRINT "< PRESS SPACE BAR > ";: GET A$: HOME : RETURN
2010 FOR XX = 1 TO 1000: NEXT XX: RETURN
8999 REM <CTRL-M><CTRL-M>SLIDE WHISTLE<CTRL-M>=============
9000 REM
9001 LE = 4: FOR PI = 254 TO 1 STEP -2: POKE 0,255 -PI: POKE 1,LE: CALL 771: NEXT
9002 FOR PI = 1 TO 50: POKE 0,255 -PI *5: POKE 1,LE: CALL 771: NEXT
9003 REM <CTRL-M><CTRL-M>MUSIC POKES<CTRL-M>===========